Handle cargo workspaces in git repositories#3482
Closed
Flamefire wants to merge 1 commit intoeasybuilders:developfrom
Closed
Handle cargo workspaces in git repositories#3482Flamefire wants to merge 1 commit intoeasybuilders:developfrom
Flamefire wants to merge 1 commit intoeasybuilders:developfrom
Conversation
Crates downloaded from crates.io can just be put into the vendored-sources directory. However a referenced git repository might contain multiple crates in a so-called "workspace". If we put such a workspace into the vendor folder, cargo fails with > found a virtual manifest at [...]Cargo.toml instead of a package manifest This solution uses a separate folder for sources downloaded from git repositories and checks them for workspaces. If they are "regular", i.e. don't have a workspace, they are put to the vendored sources from crates.io. Otherwise they are left in the git-vendor directory. Additionally refine the config.toml entry for sources vendored from git. This allows to override a specific git URL and revision with the path to the extracted repository. Otherwise we would need entries for each crate in workspaces but then cargo tries to verify the revision and fails with > Unable to update https://github.com/[...]?rev=[...] > Caused by: can't checkout from 'https://github.com/[...]': you are in the offline mode (--offline)
2fab050 to
f00d1ce
Compare
This was referenced Oct 14, 2024
Contributor
|
Going with the combined PR |
1 task
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Crates downloaded from crates.io can just be put into the vendored-sources directory.
However a referenced git repository might contain multiple crates in a so-called "workspace".
If we put such a workspace into the vendor folder, cargo fails with
This solution uses a separate folder for sources downloaded from git repositories and checks them for workspaces.
If they are "regular", i.e. don't have a workspace, they are put to the vendored sources from crates.io.
Otherwise they are left in the git-vendor directory.
Additionally refine the config.toml entry for sources vendored from git. This allows to override a specific git URL and revision with the path to the extracted repository.
Otherwise we would need entries for each crate in workspaces but then cargo tries to verify the revision and fails with
I also have a Stack Overflow question on that in case there is a better solution: https://stackoverflow.com/questions/79065892/how-to-patch-a-cargo-git-dependency-that-contains-a-workspace